/*
 * AGENT SHERPA
 *  
 * Assignement 2 of the Agent Oriented Software Engineering Course
 * M.Sc. in Advanced Software Engineering (Part-time)
 * University College Dublin www.ucd.ie
 *
 * Copyright (c) 2007 Chris Walsh, Aidan Morrisy and Iain Hull.
 * All rights reserved.
 * 
 * Filename: Main.aps
 * Author:   iain
 * Date:     06 February 2008
 */

package org.agentsherpa.model;

/**
 * A Cell location on the map
 * 
 * @author iain
 */
public class Point {
    public static final Point BadLocation = new Point(-1, 1);

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    @Override
    public String toString() {
        return "(" + x + ", " + y + ")";
    }
    
    @Override
    public boolean equals(Object rhs) {
        if (rhs instanceof Point) {
            return equals((Point) rhs);
        }
        return false;
    }

    public boolean equals(Point rhs) {
        return x == rhs.x && y == rhs.y;
    }
    
    @Override
    public int hashCode() {
        return x * 1234567 + y;
    }

    protected int x;

    protected int y;
}